package org.vectrics.recruiter.reporting;

import java.util.Date;

import org.vectrics.hibernate.Filter;
import org.vectrics.hibernate.Selector;
import org.vectrics.recruiter.job.JobStatusSubType;
import org.vectrics.recruiter.job.JobStatusType;

public class PostedInternalJobsStatQuery extends TimeQuery {

	
	protected Filter getFilter(Date startTime, Date endTime) {
		Filter filter = new Filter();
		filter.addFrom("JobStatus", "jobStatus");
		filter.addSelectField("count(distinct jobStatus)");
		filter.addParameterCondition("jobStatus.dateStart", ">", startTime);
		filter.addParameterCondition("jobStatus.dateStart", "<", endTime);
		filter.addCondition("jobStatus.voided='F'");
		filter.addParameterCondition("jobStatus.statusType.subStatusType.code", "=", 
				JobStatusSubType.SUB_STATUS_INTERNAL_POSTED);
		return(filter);
	}

	
	

}
